# -*- coding: UTF-8 -*-
import requests

# response = requests.get("https://api.xdclass.net/pub/api/v1/web/all_category")

# get请求
# data = {"video_id": 53}
# response = requests.get("https://api.xdclass.net/pub/api/v1/web/video_detail", data)

# post请求
# data = {"phone": "15737314581",
#         "pwd": "13519553700jjf"}
# response = requests.post("https://api.xdclass.net/pub/api/v1/web/web_login", data=data)

# headers
headers = {
    "token": "xdclasseyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ4ZGNsYXNzIiwicm9sZXMiOiIxIiwiaW1nIjoiaHR0cHM6Ly90aGlyZHd4LnFsb2dvLmNuL21tb3Blbi92aV8zMi9RMGo0VHdHVGZUSWZ1d3EwenRkMnRXWkZaek9sZ1JISklIVFJDN1hManNPM1lBRUtmTUliZzhtampHNnRjdW9CWGhNeUZzNmtpYTlqeGljTDRVbWx5Q0tRLzEzMiIsImlkIjo2Nzg0NDUyLCJuYW1lIjoi5a2j6aOOIiwiaWF0IjoxNjEyMzQ2MzE2LCJleHAiOjE2MTI5NTExMTZ9.gHkzQzxNdoIAaVpLGIqo8Z_IkkTilsW4dQE82DBkSyI"}
# 查询个人信息
# response = requests.get("https://api.xdclass.net/pub/api/v1/web/user_info", headers=headers)
# 收藏视频
data = {"video_id": 3}
response = requests.post("https://api.xdclass.net/pub/api/v1/web/is_favorite", headers=headers, data=data)

print(response.status_code)
print("=" * 20)
print(response.text)
print("=" * 20)
# print(response.content)
# print("="*20)
print(response.json())
